<div class="pageHeader">
    <div class="searchBar">
        <table class="searchContent">
            <tr>
                <td>
                    总共有：<?php echo $tables; ?> 张表
                </td>
                <td>
                    总大小为：<?php echo $total; ?>
                </td>
            </tr>
        </table>
        <div class="subBar">
            <div style="float: left">
                <label><input name="" class="chooseAll" type="checkbox" style="vertical-align:middle"/> 全选</label>
                <label><input name="" class="unsetAll" type="checkbox" style="vertical-align:middle"/> 反选</label>
            </div>
            <ul>
                <li>
                    <div class="buttonActive"><div class="buttonContent"><button type="submit">备份选择数据库</button></div></div>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="pageContent">
<div class="panelBar">
    <ul class="toolBar">
        <li><a class="edit" href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=run';?>" target="dialog" height="550" width="900" rel="edit_data"><span>执行sql语句</span></a></li>
    </ul>
</div>
<table class="table" width="100%" layoutH="112">
    <thead>
        <tr>
			<th width="120" align="center">
				请选择
			</th>
			<th align="center">表名</th>
			<th align="center">表用途</th>
			<th align="center">记录行数</th>
			<th align="center">引擎类型</th>
			<th align="center">字符集</th>
			<th align="center">表大小</th>
        </tr>
    </thead>
    <tbody>
    <?php foreach($list as $v){ ?>
        <tr target="sid" rel="<?php echo $v['name'];?>" >
            <td><input type="checkbox" name="table[]" value="<?php echo $v['name']; ?>"/></td>
			<td><?php echo $v['name']; ?></td>
			<td><a style="color: #ff0000" rel="data_<?php echo $v['name']; ?>" target="navTab" href="<?php echo SITE_URL . 'index.php?c='.$controller.'&a=showtable';?>"><?php echo $v['comment']; ?></a></td>
			<td><?php echo $v['rows']; ?></td>
			<td><?php echo $v['engine']; ?></td>
			<td><?php echo $v['collation']; ?></td>
			<td><?php echo $v['size']; ?></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
</div>
<!--通用处理js-->
<script type="text/javascript" src="<?php echo SITE_URL . 'theme/js/v1/admin_common.js'; ?>"></script>
<script type="text/javascript">
	$(function(){
		clickCheckbox();
		var table_count = <?php echo $tables; ?>;
		$(".submit").die().live('click',function(){
		
			alertMsg.error("数据库备份操作请联系管理员！");
			return false;
			
			if($("tbody input[type='checkbox']:checked").size()==0){
				alertMsg.error("请先选择你要备份的数据库表吧");
				return false;
			}
			if($(this).attr("disabledSubmit")){
				alertMsg.error("已提交，系统在处理中...");
			}else{
				$(this).attr("disabledSubmit",true).html("提交处理中...");
				
				var table_str = '';
				$("tbody input[type='checkbox']").each(function(){
					if($(this).attr('checked') == true){
						table_str += (table_str != '' ? ',' : '')+$(this).val();
					}
				});
				
				$(this).attr("disabledSubmit",false).html("备份选择数据库");
				
				//备份操作……backupDataBase 自动备份 手动备份（全） 手动备份（部分）
			}
		});
	});
</script>